<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=yes">
  {php}echo app('seo')->buildHtml($vars);{/php}
   <link rel="shortcut icon" href="__STATIC__/common/favicon.ico" />
  <link rel="stylesheet" href="__STATIC__/cms/css/qietu.css">
  <link rel="stylesheet" href="__STATIC__/cms/font/iconfont.css">
  <link rel="stylesheet" href="__STATIC__/cms/css/header.css">
  <link rel="stylesheet" href="__STATIC__/cms/css/style.css">
  <link rel="stylesheet" href="__STATIC__/cms/css/responsive.css">
</head>

<body>


<div class="loginpage loginpage-bg">

  <div class="login-wrap">
    <div class="login-left">
      <img src="__STATIC__/cms//imgs/img_32.jpg"/>
    </div>
    <div class="login-right login-mtop">
      <form method="post"  action="/cms/user/doForgetPassword">
        <div class="head">
          <h3>找回密码</h3>
          <p>修改密码后将重新登录</p>
        </div>
        <div class="body">
          <ul>
            <li>
              <i class="iconfont icon-yonghu"></i>
              <input type="text" class="txt" name="mobile" id="mobile" value="" placeholder="手机号"/>
            </li>
            <li>
              <i class="iconfont icon-mima"></i>
              <input type="password" class="txt" type="password" name="password" value="" placeholder="新密码"/>
            </li>
            <li>
              <i class="iconfont icon-anquanbaozhang1"></i>
              <input type="text" class="txt" type="password" name="password_confirm" value="" placeholder="确认新密码"/>
            </li>
            <li class="ver-btn">
              <i class="iconfont icon-mima"></i>
              <input type="text" class="txt txt-code" name="code" value="" placeholder="手机验证码"/>
              <a class="btn-code" href="javascript:;" id="click_checkcode">发送验证码</a>
            </li>
          </ul>
        </div>
        <div class="foot">
          <input type="submit" class="btn" value="修 改" />
        </div>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript" src="__STATIC__/cms/js/jquery.js"></script>
<script type="text/javascript" src="__STATIC__/cms/js/getVerifyCode.js"></script>
<script type="text/javascript" src="__STATIC__/cms/js/script.js"></script>
<script src="__COMMON__/layer/layer.js"></script>
<script type="text/javascript">
  $(function(){
    $('#click_checkcode').on('click',getCode);
  });
  var token = "2456b9dbf046a2f78f06c9590e5aae3c1554351103";
  function getCode(){
    var phone=$('#mobile').val();
    var reg=/\d{11}/;
    if(phone=='' || !reg.test(phone)){
      layer.msg('请填写正确的手机号码！');
      $('#mobile').focus();
      return false;
    }
    layer.prompt({
      title: '请输入验证码',
      formType: 3
    }, function (chkcode) {
      $('.getcode .code').off('click');
      $.post('/forget/sms',{chkcode: chkcode,token:token,phone:phone,t:new Date().getTime()},function(ret){
        if(ret.status===1){
          layer.closeAll();
          alert(ret.msg);
          token = ret.data.token;
          $('.getcode a i.t').html('<i class="times">80</i>秒后重发');
          timeC(80);
        } else {
          alert(ret.msg);
          $('.getcode .code').on('click',getCode);
        }
      },'json');
    })
    $('.layui-layer-prompt .layui-layer-content').prepend($(
            '<img style="cursor:pointer;height: 60px;" id="chkcode_img" src="/chkcode" onclick="javascript:this.src=\'/chkcode\'+\'?time=\'+Math.random()">'
    ))
  }

  function timeC(t){
    if(t==0){
      $('#click_checkcode').on('click',getCode);
      $('.btn-code').html('获取验证码');
      $('#click_checkcode').removeClass('unlabed');
    } else {
      t=t-1;
      $('.btn-code span.times').html(t);
      setTimeout('timeC('+t+')',1000);
    }
  }
</script>

</body>
</html>

